<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			class Animal {
				type = "动物";
				constructor(type) {
					this.type = type;
				}
				sound() {
					console.log(this.type + "在叫");
				}
			}
			class dog extends Animal {
				constructor(type) {
					super("小狗");
				}
				sound() {
					console.log(this.type + "在汪汪地叫")
				}
			}
			let dog1 = new dog()
			dog1.sound()

			class Duck extends Animal {
				constructor() {
					super("鸭子");
				}
				sound() {
					console.log(this.type + "嘎嘎的叫");
				}
			}
			let duck = new Duck()
			duck.sound();


			class Chicken extends Animal {
				constructor() {
					super("鸡");
				}
				sound() {
					console.log(this.type + "咯咯的叫");
				}
			}
			let chicken = new Chicken();
			chicken.sound();
			class Cow extends Animal {
				constructor() {
					super("牛");
				}
				sound() {
					console.log(this.type + "哞哞的叫");
				}
			}
			let cow = new Cow();
			cow.sound();
		</script>
	</body>
</html>
